function handleLogin() {
    let username = u.value;
    let password = p.value;
    $.ajax({
        url: "/check",
        data: {username, password},
        success(r) {
            if (r == -4) {
                alert("账号已经被禁用");
            } else if (r == -3) {
                alert("账号被删除");
            } else if (r == -2) {
                alert("账号和密码不匹配");
            } else if (r == -1) {
                alert("账号不存在");
            } else {
                alert("登录成功！");
                location.href="/";
            }
        }
    });
}

function handleCancel() {
    document.getElementById('u').value='';
    document.getElementById('p').value='';
}

function handleClosed() {
    if(confirm("您确定要关闭本页吗？")){
          window.opener=null;
          window.open('','_self');
          window.close();
         }


}